import {createRouter, createWebHistory,createWebHashHistory} from 'vue-router'

const router = createRouter({
    history:createWebHashHistory(process.env.BASE_URL),
    routes:[
        {
            path: '/',
            name: 'Index',
            component: () => import('@/views/index/index.vue')
        },
        {
            path: '/main',
            name: 'Main',
            meta:{
                title:'首页'
            },
            component: () => import('@/views/main/index.vue')
        },
        {
            path: '/pay',
            name: 'Pay',
            meta:{
                title:'缴费服务'
            },
            //redirect:'/pay/wy',
            component: () => import('@/views/pay/index.vue'),
            children:[
                {
                    path: 'wy',
                    name: 'wyPay',
                    meta:{
                        title:'物业缴费服务'
                    },
                    component: () => import('@/views/pay/wy/index.vue'),
                },
                {
                    path: 'wy/doPay',
                    name: 'wyPayDoPay',
                    meta:{
                        title:'物业缴费服务'
                    },
                    component: () => import('@/views/pay/wy/pay.vue'),
                },
                {
                    path: 'other',
                    name: 'otherPay',
                    meta:{
                        title:'其他缴费服务'
                    },
                    component: () => import('@/views/pay/other/index.vue'),
                },
                {
                    path: 'other/doPay',
                    name: 'otherPayDoPay',
                    meta:{
                        title:'其他缴费服务'
                    },
                    component: () => import('@/views/pay/other/pay.vue'),
                },
            ],
        },
        {
            path: '/error',
            name: 'Error',
            meta:{
                title:'404-not find page'
            },
            component: () => import('@/views/error/index.vue')
        },
    ]
})

export default router